UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ENEUILVliymQebwUmnc8O38mjgM5CwRyInC73HVlEwk=' 
WHERE 
  key_id = '87fc0eb81ac05ee2fdafa04aa1bea50612d3c3b9be6685e926dbba7b8b70cd53' 
  AND (
    token = 'ENEUILVliymQebwUmnc8O38mjgM5CwRyInC73HVlEwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052